﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ChangeSpecialSympal</title>
    <script src="~/Scripts/map/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#Change").click(function () {
                debugger;
                //adding your code here 
                var a = $("#OldValue").val();
                var reg1 = new RegExp("\\\\x3c", "g");
                var reg2 = new RegExp('\\\\x3d', 'g');
                var reg3 = new RegExp('\\\\x3e', 'g');
                var reg4 = new RegExp('\\\\x26nbsp;', 'g');
                var newstr = a.replace(reg1, '<').replace(reg2, '=').replace(reg3, '>').replace(reg4, ' ');


                var s = $("#OldValue").val();
                s = s.replace(/\\x../g, function (a) { return eval('"' + a + '"') })
                  .replace(/\\u(....)/g, function (a, b) { return String.fromCharCode(eval('0x' + b)) })

                $("#newValue").val(s);
            　　});
        }); 
    </script>
</head>
<body>
    <div> 
        <textarea id="OldValue" style="width:80%;height:100px;"></textarea><br/>
        <textarea id="newValue" style="width:80%;height:100px;"></textarea><br />
        <input type="button" id="Change" value="转换"/>

    </div>
</body>
</html>
